/**
 * 
 */
package com.handinfo.uimenu.window;

import java.io.DataInputStream;
import java.io.IOException;

import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

import com.handinfo.engine.AbstractGameScreen;
import com.handinfo.engine.Animation;
import com.handinfo.engine.GameManager;
import com.handinfo.game.AbstractGameActor;
import com.handinfo.game.ActorItem;
import com.handinfo.game.ActorRole;
import com.handinfo.game.GameScene;
import com.handinfo.uimenu.AbsHyperLinker;
import com.handinfo.uimenu.UIAbstractWindow;
import com.handinfo.uimenu.UIManager;
import com.handinfo.uimenu.UITools;
import com.handinfo.uimenu.UIWindowFactory;
import com.handinfo.util.Tools;
import com.test.touch.GameTouchManager;

/**
 * @author venizeng
 * 
 */
public class UIAttribute extends UIAbstractWindow
{

	public UIAttribute(int id)
	{
		super(id);
		setBounds(UITools.X_BG, UITools.Y_BG, W_BG, H_BG);
	}

	public static final void recvMessage(DataInputStream dis) throws IOException
	{
		short state = dis.readShort();
		String info = dis.readUTF();
		if (state == 0) {
			if (!info.equals("")) {
				GameManager.getInstance().addSystemInfo(GameManager.SYSTEM_INFO_TYPE_B, info);
			}
			return;
		}
		UIAttribute attribute2 = (UIAttribute) UIManager.getInstance()
				.getWindowById(UIWindowFactory.WINDOW_ATTRIBUTE);
		if (attribute2 != null) {//重复调用
			return;
		}
		attribute2 = (UIAttribute) UIWindowFactory.createWindow(UIWindowFactory.WINDOW_ATTRIBUTE);
		attribute2.recvInfos(dis);
		attribute2.initPos();
		attribute2.m_state = -1;
		attribute2.changeState(attribute2.STATE_BASIC);
		UIManager.getInstance().addWindow(attribute2);
	}

	/**
	 * 初始化各个显示元素的位置信息 2012-3-14 下午06:48:55 venizeng
	 */
	private void initPos()
	{
		int borderH = UITools.IW_RECT_CONTENT << 1;
		// Const
		W_RECT_CONTENTS = UITools.W_RECT_DRAG;
		// Fight
		H_FIGHT_DESCRIBE = H_PRE + (UITools.IH_RECT_CONTENT << 1);
		H_RECT_CONTENTS_FIGHT = UITools.H_RECT - (H_LABEL + UITools.IH_RECTS) - (H_FIGHT_DESCRIBE + UITools.IH_RECTS);
		NUM_CONTENT_FIGHT = ((H_RECT_CONTENTS_FIGHT - borderH) / H_PRE);
		H_CONTENT_CONTENTS_FIGHT = NUM_CONTENT_FIGHT * H_PRE;
		// Others
		H_RECT_CONTENTS_OTHERS = UITools.H_RECT - (H_LABEL + UITools.IH_RECTS);
		NUM_CONTENT_OTHERS = ((H_RECT_CONTENTS_OTHERS - borderH) / H_PRE);
		H_CONTENT_CONTENTS_OTHERS = NUM_CONTENT_OTHERS * H_PRE;
		// XY
		Y_LABEL = UITools.INITY_CONTENT + UITools.IH_RECTS;
		X_LABEL_ARR_LEFT = UITools.INITX_CONTENT;
		X_LABEL_ARR_RIGHT = W_BG - X_LABEL_ARR_LEFT - (UIManager.IMAGE_LABEL_ARR.getWidth());;
		X_LABEL_FIRST = ((W_BG - (NUM_LABEL_DIS * W_LABEL + (NUM_LABEL_DIS - 1) * UITools.IW_RECT_CONTENT)) >> 1);// 居中显示
		//
		X_BASIC_CONTENTS = UITools.INITX_CONTENT;
		//
		X_OTHERS_CONTENTS = UITools.INITX_CONTENT;
		Y_OTHERS_CONTENTS = Y_LABEL + H_LABEL + UITools.IH_RECTS;
		//
		X_FIGHT_DESCRIBE = UITools.INITX_CONTENT;
		Y_FIGHT_DESCRIBE = Y_OTHERS_CONTENTS + H_RECT_CONTENTS_FIGHT + UITools.IH_RECTS;

		boolean isSelf = isSelf();
		// 自己的边框
		if (isSelf) {
			W_RECT_SELF_BASIC = UITools.W_RECT - W_ANIM - UITools.IW_RECTS;
			H_RECT_SELF_BASIC = H_ANIM;
			W_RECT_INFO_BASIC_NAME = W_RECT_SELF_BASIC - (UITools.IW_RECT_CONTENT << 1)
					- (AbstractGameScreen.s_font.stringWidth(ATT_STR_BASIC_NICKNAME) + 1);
			// Basic
			H_RECT_CONTENTS_BASIC = UITools.H_RECT - (H_LABEL + UITools.IH_RECTS) - (H_ANIM + UITools.IH_RECTS);
			NUM_CONTENT_BASIC = ((H_RECT_CONTENTS_BASIC - borderH) / H_PRE);
			H_CONTENT_CONTENTS_BASIC = NUM_CONTENT_BASIC * H_PRE;
			//
			X_ANIM_BASIC_SELF = UITools.INITX_CONTENT;
			Y_ANIM_BASIC = Y_LABEL + H_LABEL + UITools.IH_RECTS;
			X_SELF_BASIC = X_ANIM_BASIC_SELF + W_ANIM + UITools.IW_RECTS;
			Y_SELF_BASIC = Y_ANIM_BASIC;
			Y_BASIC_CONTENTS = Y_ANIM_BASIC + H_ANIM + UITools.IH_RECTS;
		}
		else {
			RW_EQUIP = UITools.W_BAG + IW_EQUIP;
			RH_EQUIP = UITools.H_BAG + IH_EQUIP;
			//
			int H = RH_EQUIP * 3 - IW_EQUIP;
			H_RECT_CONTENTS_BASIC = UITools.H_RECT - (H_LABEL + UITools.IH_RECTS) - (H + UITools.IH_RECTS);
			NUM_CONTENT_BASIC = ((H_RECT_CONTENTS_BASIC - borderH) / H_PRE);
			H_CONTENT_CONTENTS_BASIC = NUM_CONTENT_BASIC * H_PRE;
			//
			NUM_CONTENT_FIGHT = ((H_RECT_CONTENTS_FIGHT - borderH) / H_PRE);
			H_CONTENT_CONTENTS_FIGHT = NUM_CONTENT_FIGHT * H_PRE;
			//
			X_EQUIP_LEFT = UITools.INITX_CONTENT;
			Y_EQUIP = Y_LABEL + H_LABEL + UITools.IH_RECTS;
			X_EQUIP_RIGHT = W_BG - X_EQUIP_LEFT - ((RW_EQUIP << 1) - IW_EQUIP);
			X_ANIM_BASIC_OTHER = ((W_BG - W_ANIM) >> 1);
			//
			Y_ANIM_BASIC = Y_EQUIP + ((H - H_ANIM) >> 1);
			Y_BASIC_CONTENTS = Y_EQUIP + H + UITools.IH_RECTS;
		}
	}

	private void recvInfos(DataInputStream dis) throws IOException
	{
		m_id = dis.readLong();// 这里需要从服务器中获得，目前没有无此项数据
		if (m_id != GameManager.getInstance().m_role.m_gameID) {// 他人
			int num_equip = dis.readInt();
			m_items = new ActorItem[ActorRole.NUM_BAG_EQUIPMENT];
			for (int i = 0; i < num_equip; i++) {
				int index = dis.readInt();
				ActorItem item = new ActorItem();
				item.m_index = index;
				item.m_guid = dis.readLong();
				item.m_iconId = dis.readShort();
				item.m_iconCoverId = dis.readShort();
				//
				if (m_items[index] != null) {
//					Tools.debugPrintln("传错了位置 Index = " + index);
					return;
				}
				m_items[index] = item;
			}
		}
		m_role = ((GameScene) GameManager.getInstance().m_scene).getRoleByID(m_id);
//		m_basic_name = dis.readUTF() ;
//		m_basic_race = dis.readUTF() ;
		//
		int num_infos = dis.readInt();
		if (num_infos <= 0) {
			Tools.debugPrintln("错误，未传属性数据进来");
			return;
		}
		m_keys = new short[num_infos][];
		H_ITEMS = new short[num_infos][];
		H_SUMS = new int[num_infos];
		for (int i = 0; i < m_keys.length; i++) {
			int num_item = dis.readInt();
			m_keys[i] = new short[num_item];
			H_ITEMS[i] = new short[num_item];
			for (int j = 0; j < m_keys[i].length; j++) {
				m_keys[i][j] = dis.readShort();
				recvInfo(dis, m_keys[i][j]);
				H_ITEMS[i][j] = (short) getItemHeight(m_keys[i][j]);
				H_SUMS[i] += H_ITEMS[i][j];
			}
		}
		changeState(STATE_BASIC);
	}

	public static String changeTime(long sec)
	{
		int sec_day = 24 * 3600;
		int day = (int) (sec / sec_day);
		sec -= day * sec_day;
		int hour = (int) (sec / 3600);
		sec -= hour * 3600;
		int min = (int) (sec / 60);
		StringBuffer sb = new StringBuffer(10);
		sb.append(day).append("天").append(hour).append("时").append(min).append("分");
		return sb.toString();
	}

	private void recvInfo(DataInputStream dis, short key) throws IOException
	{
		switch (key) {
			case id_name:// 名称：
				m_basic_name = dis.readUTF();
				break;
			case id_zhongzu:// 种族：
				m_basic_race = dis.readUTF();
				break;
			case id_xingbie:// 性别：
				m_basic_sex = dis.readUTF();
				break;
			case id_zhiye:// 职业：
				m_basic_career = dis.readByte();
				break;
			case id_dengji:// ：
				m_basic_level_curr = dis.readInt();
				if (m_basic_level_curr <= 0) {
					key = NUMBER_USELESS;
				}
				break;
			case id_zhenying://阵营
				byte zhenying = dis.readByte();
				if (zhenying < 0 || zhenying >= AbstractGameActor.ROLE_FACTION_LIST.length) {
					m_basic_zhenying = "";
				}
				else {
					m_basic_zhenying = AbstractGameActor.ROLE_FACTION_LIST[zhenying];
				}
				break;
			case id_dangqianjingyan:// 当前经验：
				m_basic_exper_curr = dis.readInt();
				break;
			case id_xiajijingyan:// 下级经验：
				m_basic_exper_next = dis.readInt();
				break;
			case id_jingli:
				m_basic_jingli = dis.readInt();
				break;
			case id_shenghuojinengA:// 名称：
				m_basic_skillLife_a = dis.readUTF();
				break;
			case id_shenghuodengjiA:// 名称：
				m_basic_levelLife_a = dis.readUTF();
				break;
			case id_shenghuojinengB:// 名称：
				m_basic_skillLife_b = dis.readUTF();
				break;
			case id_shenghuodengjiB:// 名称：
				m_basic_levelLife_b = dis.readUTF();
				break;
			case id_caiji:
				m_basic_caiji = dis.readUTF();
				break;
			case id_tgf:
				m_basic_tgf = dis.readUTF();
				break;
			case id_bgl:
				m_basic_bgl = dis.readUTF();
				break;
			case id_hyper:
				m_hyper = AbsHyperLinker.createHyperLinker(dis.readUTF(),W_RECT_CONTENTS , 0);
				m_hyper.setH(m_hyper.getRealHeight());
				break ;	
				
			case id_vip_level:
				m_basic_vip_level = dis.readByte() + "级";
				break;
			case id_vip_time:
				m_basic_vip_time = changeTime(dis.readLong());
				break;
			case id_vip_time_de:
				m_basic_vip_de = changeTime(dis.readLong());
				break;
			//	
			case ID_BASIC_MONEYGAME:// 钱：
				m_basic_money_game = dis.readLong();
				break;
			case ID_BASIC_MONEYRMB:// 元宝：
				m_basic_money_rmb = dis.readLong();
				break;
			case ID_BASIC_MONEYYINPIAO:// 名称：
				m_basic_money_yingpiao = dis.readLong();
				break;
			//
			case id_zhuangbeipinfen:// 
				zhuangbeipinfen = dis.readInt();
				break;
			case id_maxHp:// HP：
				maxHp = dis.readInt();
				break;
			case id_maxMp:// MP：
				maxMp = dis.readInt();
				break;
			//
			case id_wuligongji:// 名称：
				wuligongji = dis.readInt();
				break;
			case id_zuixiaofagong:// 名称：
				zuixiaofagong = dis.readInt();
				break;
			case id_zuidafagong:// 名称：
				zuidafagong = dis.readInt();
				break;
			case id_wulifangyu:// 名称：
				wulifangyu = dis.readInt();
				break;
			case id_fasufangyu:// 名称：
				fasufangyu = dis.readInt();
				break;
			case id_jichumingzhong:// 名称：
				jichumingzhong = dis.readInt();
				break;
			case id_liliang:// 名称：
				liliang = dis.readInt();
				break;
			case id_zhili:// 名称：
				zhili = dis.readInt();
				break;
			case id_jiqiao:// 名称：
				jiqiao = dis.readInt();
				break;
			case id_minjie:// 名称：
				minjie = dis.readInt();
				break;
			case id_naili:// 名称：
				naili = dis.readInt();
				break;
			case id_luck:// 名称：
				luck = dis.readInt();
				break;
			case id_hphuifusudu:// 名称：
				hphuifusudu = dis.readInt();
				break;
			case id_mphuifusudu:// 名称：
				mphuifusudu = dis.readInt();
				break;
			case id_jianqihuifu:
				jianqihuifu = dis.readInt();
				break;
			case id_douqihuifu:
				douqihuifu = dis.readInt();
				break;
			case id_fashangjiacheng:// 名称：
				fashangjiacheng = dis.readInt();
				break;
			case id_yinxingshanghaijiacheng:// 名称：
				yinxingshanghaijiacheng = dis.readInt();
				break;
			case id_bingxingqianghua:
				bingxingqianghua = dis.readInt();
				break;
			case id_huangxingqianghua:// 名称：
				huangxingqianghua = dis.readInt();
				break;
			case id_shengxingqianghua:// 名称：
				shengxingqianghua = dis.readInt();
				break;
			case id_wulibaojilv:// 名称：
				wulibaojilv = dis.readInt();
				break;
			case id_fasubaojilv:// 名称：
				fasubaojilv = dis.readInt();
				break;
			case id_wubaoshanghaijaicheng:// 名称：
				wubaoshanghaijaicheng = dis.readInt();
				break;
			case id_fabaoshanghaijiacheng:// 名称：
				fabaoshanghaijiacheng = dis.readInt();
				break;
			case id_wulichuantou:// 名称：
				wulichuantou = dis.readInt();
				break;
			case id_fasuchuantou:// 名称：
				fasuchuantou = dis.readInt();
				break;
			case id_huibilv:// 名称：
				huibilv = dis.readInt();
				break;
			case id_wushangjianmian:// 名称：
				wushangjianmian = dis.readInt();
				break;
			case id_fashangjianmian:// 名称：
				fashangjianmian = dis.readInt();
				break;
			case id_baojishanghaijianmian:// 名称：
				baojishanghaijianmian = dis.readInt();
				break;
			case id_yinkangxingjiacheng:
				yinkangxingjiacheng = dis.readInt();
				break;
			case id_bingkangqianghua:// 名称：
				bingkangqianghua = dis.readInt();
				break;
			case id_huangkangqianghua:// 名称：
				huangkangqianghua = dis.readInt();
				break;
			case id_shengkangqianghua:// 名称：
				shengkangqianghua = dis.readInt();
				break;
			//
			case id_jiazu:// 名称：
				jiazu = dis.readUTF();
				break;
			case id_jiazugongxian:
				jiazugongxian = dis.readUTF();
				break;
			case id_chenghao:// 名称：
				chenghao = dis.readUTF();
				break;
			case id_zhangongdianshu:
				zhangongdianshu = dis.readInt();
				break;
			case id_peiou:// 名称：
				peiou = dis.readUTF();
				break;
			case id_peiouqinmidu:// 名称：
				peiouqinmidu = dis.readInt();
				break;
			case id_shifuchengjiudu:// 名称：
				shifuchengjiudu = dis.readInt();
				break;
			case id_shijiepaiming:
				shijiepaiming = dis.readInt();
				break;
			case id_zhenyingpaiming:
				zhenyingpaiming = dis.readInt();
				break;
			case id_jiazupaiming:
				jiazupaiming = dis.readInt();
				break;
			case id_qiechuoshengli:
				qiechuoshengli = dis.readInt();
				break;
			case id_qiechuobaibei:
				qiechuobaibei = dis.readInt();
				break;
			case id_shadishumu:
				shadishumu = dis.readInt();
				break;
			case id_beishacishu:
				beishashucishu = dis.readInt();
				break;
			case id_dongfupaiming:
				dongfupaiming = dis.readInt();
				break;
			case id_shengchangcishu:
				shengchangcishu = dis.readInt();
				break;
			default:
				Tools.debugPrintln("Recv UIAttribute:错误的key值= " + key);
				break;
		}
	}

	private int getItemHeight(short key)
	{
		switch (key) {
			case id_name:
				break;
			case id_zhiye:
				break;
			case id_zhongzu:
				break;
			case id_xingbie:
				break;
			case id_dengji:
				break;
			case id_zhenying:
				break;
			case id_dangqianjingyan:
				break;
			case id_xiajijingyan:
				break;
			case id_jingli:
				break;
			case id_shenghuojinengA:
				break;
			case id_shenghuodengjiA:
				break;
			case id_shenghuojinengB:
				break;
			case id_shenghuodengjiB:
				break;
			case id_vip_level:
			case id_vip_time:
			case id_vip_time_de:
			case id_caiji:
			case id_tgf:
			case id_bgl:
				
				break;
			//
			case id_zhuangbeipinfen:
				break;
			case id_maxHp:
				break;
			case id_maxMp:
				break;
			case id_wuligongji:
				break;
			case id_zuixiaofagong:
				break;
			case id_zuidafagong:
				break;
			case id_wulifangyu:
				break;
			case id_fasufangyu:
				break;
			case id_jichumingzhong:
				break;
			case id_liliang:
				break;
			case id_zhili:
				break;
			case id_jiqiao:
				break;
			case id_minjie:
				break;
			case id_naili:
				break;
			case id_luck:
				break;
			case id_hphuifusudu:
				break;
			case id_mphuifusudu:
				break;
			case id_jianqihuifu:
				break;
			case id_douqihuifu:
				break;
			case id_fashangjiacheng:
				break;
			case id_yinxingshanghaijiacheng:
				break;
			case id_bingxingqianghua:
				break;
			case id_huangxingqianghua:
				break;
			case id_shengxingqianghua:
				break;
			case id_wulibaojilv:
				break;
			case id_fasubaojilv:
				break;
			case id_wubaoshanghaijaicheng:
				break;
			case id_fabaoshanghaijiacheng:
				break;
			case id_wulichuantou:
				break;
			case id_fasuchuantou:
				break;
			case id_huibilv:
				break;
			case id_wushangjianmian:
				break;
			case id_fashangjianmian:
				break;
			case id_baojishanghaijianmian:
				break;
			case id_yinkangxingjiacheng:
				break;
			case id_bingkangqianghua:
				break;
			case id_huangkangqianghua:
				break;
			case id_shengkangqianghua:
				break;
			//
			case id_jiazu:
				break;
			case id_jiazugongxian:
				break;
			case id_chenghao:
				break;
			case id_zhangongdianshu:
				break;
			case id_peiou:
				break;
			case id_peiouqinmidu:
				break;
			case id_shifuchengjiudu:
				break;
			//
			case id_shijiepaiming:
				break;
			case id_zhenyingpaiming:
				break;
			case id_jiazupaiming:
				break;
			case id_qiechuoshengli:
				break;
			case id_qiechuobaibei:
				break;
			case id_shadishumu:
				break;
			case id_beishacishu:
				break;
			case id_dongfupaiming:
				break;
			case id_shengchangcishu:
				break;

			case id_hyper:
				if (m_hyper != null) {
					return m_hyper.getRealHeight();
				}
				break ;
		}
		return H_PRE;
	}

	protected void actionOnStateChanged()
	{
		switch (m_state) {
			case STATE_BASIC:
				m_h_rect = H_RECT_CONTENTS_BASIC;
				m_num_dis = NUM_CONTENT_BASIC;
				m_h_content = H_CONTENT_CONTENTS_BASIC;
				m_y_drag = Y_BASIC_CONTENTS;
				break;
			case STATE_FIGHT:
				m_h_rect = H_RECT_CONTENTS_FIGHT;
				m_num_dis = NUM_CONTENT_FIGHT;
				m_h_content = H_CONTENT_CONTENTS_FIGHT;
				m_y_drag = Y_OTHERS_CONTENTS;
				//
				m_index_top = 0;
				break;
			default:
				m_h_rect = H_RECT_CONTENTS_OTHERS;
				m_num_dis = NUM_CONTENT_OTHERS;
				m_h_content = H_CONTENT_CONTENTS_OTHERS;
				m_y_drag = Y_OTHERS_CONTENTS;
				break;
		}

		if (m_state_first > m_state) {
			m_state_first = m_state;
		}
		else if (m_state_first + NUM_LABEL_DIS <= m_state) {
			int num = m_state - (NUM_LABEL_DIS - 1);
			m_state_first = num < 0 ? 0 : num;
		}

		m_index_top = 0;
		m_relY = 0;
		m_plan = 0;
		m_relX_fight = 0;
	}

	protected void actionOnIndexChanged()
	{
		switch (m_state) {
			case STATE_BASIC:
				break;
			case STATE_FIGHT:
				short[] Hs = H_ITEMS[getLabelIndex()];
				if (Hs == null) {
					return;
				}
				int iw = 3;
				m_x_fos = X_OTHERS_CONTENTS + iw;
				int H = 0;
				for (int i = 0; i < m_index; i++) {
					H += Hs[i];
				}
				m_y_fos = Y_OTHERS_CONTENTS + H + m_relY + UITools.IW_RECT_CONTENT;
				m_w_fos = W_RECT_CONTENTS - (iw << 1);
				m_h_fos = Hs[m_index];
				//
				if (m_index == Hs.length - 1) {
					m_plan = 100;
				}
				else {
					m_plan = 100 * H / H_SUMS[getLabelIndex()];
				}
				m_str_fight_describe = getFightDescribe(m_keys[getLabelIndex()][m_index]);
				break;
			default:
				break;
		}
		m_relX_fight = 0;
	}

	private String getFightDescribe(short key)
	{
		switch (key) {
			case id_wuligongji:// 物理攻击:
				return "武器的物理伤害值";
			case id_zuixiaofagong:// 最小法攻:
				return "武器的法术伤害最小值";
			case id_zuidafagong:// 最大法攻
				return "武器的法术伤害最大值";
			case id_wulifangyu:// 物理防御:
				return "角色从装备上获得的所有物理防御总和";
			case id_fasufangyu:// 法术防御
				return "角色从装备上获得的所有法术防御总和";
			case id_wushangjianmian:// 物伤减免
				return "角色受到物理伤害时,可以减免伤害的百分比";
			case id_fashangjianmian:// 法伤减免
				return "角色受到法术伤害时,可以减免伤害的百分比";
			case id_huibilv:// 回避率
				return "角色的回避能力,能够降低对手命中自己的机会";
			case id_baojishanghaijianmian:// 暴击伤害减免
				return "角色受到暴击伤害时,可以减免伤害的百分比";
			case id_hphuifusudu:// HP恢复速度
				return "战斗开始后,HP自动恢复的速度";
			case id_mphuifusudu:// MP恢复速度
				return "战斗开始后,MP自动恢复的速度";
			case id_yinkangxingjiacheng:// 阴抗强化
				return "抵抗对方阴性状态攻击的几率";
			case id_bingkangqianghua:// 冰抗强化
				return "抵抗对方冰性状态攻击的几率";
			case id_huangkangqianghua:// 煌抗强化
				return "抵抗对方煌性攻击的几率";
			case id_shengkangqianghua:// 圣抗强化
				return "抵抗对方圣性状态攻击的几率";
			case id_wulibaojilv:// 物理暴击
				return "物理攻击时的暴击出现几率";
			case id_fasubaojilv:// 法术暴击
				return "法术攻击时的暴击出现几率";
			case id_jichumingzhong:// 基础命中
				return "物理系伤害的命中值";
			case id_fasuchuantou:// 法术穿透
				return "法术系伤害的命中值";
			case id_wulichuantou:// 物理穿透
				return "物理攻击无视对手防御减伤的几率";
			case id_wubaoshanghaijaicheng:// 物暴伤害加
				return "物理暴击伤害的增加百分比";
			case id_fabaoshanghaijiacheng:// 法暴伤害加
				return "法术暴击伤害的增加百分比";
			case id_shengxingqianghua:// 圣性强化
				return "圣属性伤害的增加百分比";
			case id_huangxingqianghua:// 煌性强化
				return "煌属性伤害的增加百分比";
			case id_bingxingqianghua:// 冰性强化
				return "冰属性伤害的增加百分比";
			case id_yinxingshanghaijiacheng:// 阴性强化
				return "阴属性伤害的增加百分比";
			case id_fashangjiacheng:// 法伤加成
				return "法术暴击伤害的增加百分比";
			case id_liliang:// 力量
				return "决定角色物理攻击的强度比例,数值越高,伤害越高";
			case id_zhili:// 智力
				return "决定角色法术攻击的强度比例,数值越高,伤害越高;同时也决定了角色的MAXMP量";
			case id_jiqiao:// 技巧
				return "决定角色命中能力的数值,数值越高,命中值越高";
			case id_minjie:// 敏捷
				return "决定角色敏捷能力的数值,数值越高,回避值越高,部分特定技能的伤害越高";
			case id_naili:// 耐力
				return "决定角色经受打击能力和MAXHP的上限";
			case id_luck:// 运气
				return "决定角色几乎所有需要靠几率进行运算的数值,越高越有利";
			case id_jianqihuifu:// 剑气恢复+,
				return "释放特定技能会增加,每间隔2秒也会自动增加,剑客释放技能时需要消耗,同时消耗的剑气对于某些技能有伤害加成";
			case id_douqihuifu:// 斗气恢复+
				return "受到伤害或释放特定技能会增加,力士施放技能时需要消耗,战斗结束后会快速流失到0";
			case id_maxHp:
				return "你的体力最大值";
			case id_maxMp:
				switch (m_basic_career) {
					case 1:// 剑客
					case 4:// 剑俠
					case 5:// 剑豪
					case 10:// 剑神
					case 11:// 剑魔
					case 12:// 剑圣
						return "剑气积蓄的多少决定了剑气技能的威力";
					case 2:// 武者
					case 6:// 猛将
					case 7:// 斗士
					case 13:// 战狂
					case 14:// 天将
					case 15:// 武圣
						return "刀客的斗气值从0到100，低于50为蓝色，高于50为红色";
					case 3:// 道士
					case 8:// 方士
					case 9:// 术士
					case 16:// 阎罗
					case 17:// 天师
					case 18:// 道圣
						return "道士释放法术，需要消耗MP";
				}
				return "";
			case id_zhuangbeipinfen:
				return "你身上所有装备的品阶总分";
			default:
				return "";
		}
	}

	protected void keyLogic()
	{
		if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_RIGHT_SOFT)) {
			close();
		}
		else if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_D)) {
			if (m_state == STATE_BASIC) {
				changeState(STATE_RONGYU);
			}
			else {
				changeState(m_state - 1);
			}
		}
		else if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_B)) {
			if (m_state == STATE_RONGYU) {
				changeState(STATE_BASIC);
			}
			else {
				changeState(m_state + 1);
			}
		}
		else {
			switch (m_state) {
				case STATE_BASIC:
					if (isSelf()) {
					}
					else {
						keyLogicONBasicOther();
					}
					break;
				case STATE_FIGHT:
					keyLogicONFight();
					break;
				default:
					keyLogicOnOthers();
					break;
			}
		}
	}

	private void keyLogicONBasicOther()
	{
		if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_UP)) {
			if (m_index < 2 || m_index == 6 || m_index == 7) {
				setWindowIndex(m_index + 4);
			}
			else {
				setWindowIndex(m_index - 2);
			}
		}
		else if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_DOWN)) {
			if (m_index > 10 || m_index == 4 || m_index == 5) {
				setWindowIndex(m_index - 4);
			}
			else {
				setWindowIndex(m_index + 2);
			}
		}
		else if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_LEFT)) {
			if (m_index % 2 == 0) {// 偶数列
				if (m_index < 6) {
					setWindowIndex(m_index + 7);// 跳到当前行末尾
				}
				else {
					setWindowIndex(m_index - 5);// 跳到当前行末尾
				}
			}
			else {
				setWindowIndex(m_index - 1);//
			}
		}
		else if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_RIGHT)) {
			if (m_index % 2 == 1) {// 奇数列
				if (m_index < 6) {
					setWindowIndex(m_index + 5);// 跳到当前行末尾
				}
				else {
					setWindowIndex(m_index - 7);// 跳到当前行末尾
				}
			}
			else {
				setWindowIndex(m_index + 1);//
			}
		}
		else if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_KEY0)) {
			ActorItem item = m_items[getDataIndex(m_index)];
			if (item == null) {
				return;
			}
//			GameManager.getInstance().m_game_message.sendActorItemDetail(item.m_guid);
			GameManager.getInstance().m_game_message.sendOtherRoleActorItemDetail(m_id, item.m_guid);
		}
	}

	private int getDataIndex(int groupIndex)
	{
		switch (groupIndex) {
			case 0:
			case 1:
				return groupIndex;
			case 2:
			case 3:
				return groupIndex + 2;
			case 4:
			case 5:
				return groupIndex + 4;
			case 6:
			case 7:
				return groupIndex - 4;
			case 8:
			case 9:
				return groupIndex - 2;
			case 10:
			case 11:
				return groupIndex;
		}
		return 0;
	}

	private void keyLogicOnOthers()
	{
		if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_UP)) {
			if (isDataTopEst()) {
				return;
			}
			changeRelY(m_relY + H_PRE);
		}
		else if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_DOWN)) {
			if (isDataBottomEst()) {
				return;
			}
			changeRelY(m_relY - H_PRE);
		}
	}

	/**
	 * 选中区域是否数据最底 2012-3-14 下午11:32:23 venizeng
	 * @return
	 */
	private boolean isDataBottomEst()
	{
		return m_relY <= getExpectTopY();
	}

	private void changeRelY(int relY)
	{
		m_relY = relY;
		int topY = getExpectTopY();
		if (topY == 0) {
			m_plan = 0;
		}
		else {
			m_plan = m_relY * 100 / topY;
		}
	}

	private int getExpectTopY()
	{
		int py = H_SUMS[getLabelIndex()] - m_h_content;
		return py > 0 ? py = -py : 0;
	}

	/**
	 * 选中区域是否数据最底 2012-3-14 下午11:32:23 venizeng
	 * @return
	 */
	private boolean isDataTopEst()
	{
		return m_relY == 0;
	}

	private void keyLogicONFight()
	{
		if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_UP)) {
			if (m_index == m_index_top) {// 显示最上
				if (m_index_top != 0) {
					changeTopIndex(m_index_top - 1);
					setWindowIndex(m_index - 1);// 需在修改TopIndex之后
				}
			}
			else {
				setWindowIndex(m_index - 1);
			}
		}
		else if (AbstractGameScreen.haveKeyPressed(AbstractGameScreen.GK_DOWN)) {
			if (m_index >= m_keys[getLabelIndex()].length - 1) {
				return;
			}
			if (m_index == m_index_top + m_num_dis - 1) {
				changeTopIndex(m_index_top + 1);
				setWindowIndex(m_index + 1);
			}
			else {
				setWindowIndex(m_index + 1);
			}
		}
	}

	private void changeTopIndex(int index)
	{
		if (m_index_top > index) {// 向上
			m_relY += H_PRE;
		}
		else if (m_index_top < index) {
			m_relY -= H_PRE;
		}
		m_index_top = index;
	}

	/**
	 * 修改状态的时候也同时修改索引 2012-3-15 上午09:54:08 venizeng
	 * @param state
	 */
	private void changeState(int state)
	{
		setWindowStatus(state);
		m_index = -1;// 赋0
		setWindowIndex(0);
		m_y_basic = 0;
	}

	/**
	 * 是否是自己 2012-3-14 下午08:01:09 venizeng
	 * @return
	 */
	private boolean isSelf()
	{
		return GameManager.getInstance().m_role.m_gameID == m_id;
	}

	/**
	 * 获得标签的索引 2012-3-14 下午08:00:40 venizeng
	 * @return
	 */
	private int getLabelIndex()
	{
		return m_state - STATE_BASIC;
	}

	protected void paintContent(Graphics g)
	{
		paintBackground(g);
//		paintLabelArrs(g);
		paintLabels(g);
		paintAnim(g);
		paintEqups(g);
		paintBasicInfo(g);
		paintContents(g);
		paintDrag(g);
		paintFocused(g);
		paintFightDescribe(g);
	}

	private void paintBackground(Graphics g)
	{
		String temp = null;
		if (m_state == STATE_BASIC && !isSelf()) {
			temp = STR_BASIC_OTHER;
		}
		UITools.paintBackGround(g, m_x, m_y, m_w, m_h, TITLE, temp, true, true);
	}

	private void paintLabelArrs(Graphics g)
	{
		// 最后一个参数为true，因为可循环选择
		boolean isLight = true;
		boolean isLeft = true;
		UITools.paintLabelArr(g, m_x + X_LABEL_ARR_LEFT, m_y + Y_LABEL, isLeft, isLight);
		UITools.paintLabelArr(g, m_x + X_LABEL_ARR_RIGHT, m_y + Y_LABEL, !isLeft, isLight);
	}

	private void paintLabels(Graphics g)
	{
		int tempX = m_x + X_LABEL_FIRST;
		int tempY = m_y + Y_LABEL;
		for (int i = 0; i < NUM_LABEL_DIS; i++) {
			int state = m_state_first + i;
			Image temp = null;
			switch (state) {
				case STATE_BASIC:
					temp = UIManager.IMAGE_LABEL_JICHU;
					break;
				case STATE_FIGHT:
					temp = UIManager.IMAGE_LABEL_ZHANDOU;
					break;
				case STATE_SHEHUI:
					temp = UIManager.IMAGE_LABEL_SHENGWANG;
					break;
				case STATE_RONGYU:
					temp = UIManager.IMAGE_LABEL_RONGYU;
					break;
			}
			boolean isSel = state == m_state;
			UITools.paintLabelImage(g, tempX, tempY, W_LABEL, H_LABEL, temp, isSel);
			tempX += (W_LABEL + IW_LABEL);
		}
	}

	private void paintEqups(Graphics g)
	{
		if (m_items == null) {
			return;
		}
		if (m_state != STATE_BASIC) {
			return;
		}
		paintEquips(g, m_x + X_EQUIP_LEFT, m_y + Y_EQUIP, true);
		paintEquips(g, m_x + X_EQUIP_RIGHT, m_y + Y_EQUIP, false);
	}

	private void paintEquips(Graphics g, int x, int y, boolean isLeft)
	{
		int tempY = y;
		int index = isLeft ? 0 : 6;// 起始
		int dataIndex = isLeft ? 0 : 2;
		boolean isFocused = false;
		final boolean isSel = false;
		final boolean isOpen = true;
		for (int i = 0; i < 3; i++) {
			int tempX = x;
			for (int j = 0; j < 2; j++) {
				isFocused = m_index == index;
				UITools.paintEquipBar(g, tempX, tempY, m_items[dataIndex + j], isSel, isFocused, isOpen,
						NAME_EQUIP_POS[index]);
				tempX += RW_EQUIP;
				index++;
			}
			tempY += RH_EQUIP;
			dataIndex += 4;
		}
	}

	private void paintAnim(Graphics g)
	{
		if (m_state != STATE_BASIC) {
			return;
		}
		int tempX = m_x;
		int tempY = m_y;
		if (isSelf()) {
			tempX += X_ANIM_BASIC_SELF;
			tempY += Y_ANIM_BASIC;
		}
		else {
			tempX += X_ANIM_BASIC_OTHER;
			tempY += Y_ANIM_BASIC;
		}
		UITools.paintContentRect(g, tempX, tempY, W_ANIM, H_ANIM);
		if (m_role == null) {
			paintShadowAnim(g, tempX, tempY);
		}
		else {
			Animation[] animations = m_role.m_anims;
			if (animations == null) {
				paintShadowAnim(g, tempX, tempY);
				return;
			}
			for (int i = 1; i < animations.length; i++) {
				if (animations[i] == null) {
					continue;
				}
				if (animations[i].m_actions == null) {
					continue;
				}
				if (m_actionId >= animations[i].m_actions.length) {
					continue;
				}
				if (m_frameIndex >= animations[i].m_actions[m_actionId].length) {
					continue;
				}
				animations[i].draw(g, tempX + (W_ANIM >> 1), tempY + (H_ANIM) - 3, false, false,
						animations[i].m_actions[m_actionId][m_frameIndex] & 0x03FF);
			}
			//
			if (animations[1] == null) {
				return;
			}
			if (animations[1].m_actions == null) {
				return;
			}
			if (m_actionId >= animations[1].m_actions.length) {
				return;
			}
			int num_frame = animations[1].m_actions[m_actionId].length;
			m_frameIndex++;
			if (m_frameIndex >= num_frame) {
				m_frameIndex = 0;
			}
		}
	}

	private void paintShadowAnim(Graphics g, int tempX, int tempY)
	{
		Animation animation = GameManager.getInstance().m_shadowAnimation;
		if (animation == null) {
			return;
		}
		animation.draw(g, tempX + (W_ANIM >> 1), tempY + H_ANIM - 3, false, false,
				animation.m_actions[m_actionId][m_frameIndex] & 0x03FF);
	}

	private void paintBasicInfo(Graphics g)
	{
		if (m_state != STATE_BASIC) {
			return;
		}
		if (!isSelf()) {
			return;
		}
		int tempX = m_x + X_SELF_BASIC;
		int tempY = m_y + Y_SELF_BASIC;
		// 绘制玩家属性（自己的）的外框
		UITools.paintContentRect(g, tempX, tempY, W_RECT_SELF_BASIC, H_RECT_SELF_BASIC);
		// 绘制属性名字
		tempX += UITools.IW_RECT_CONTENT;
		tempY += UITools.IH_RECT_CONTENT;
		int INITY = tempY;
		g.setColor(UIManager.getPaletteColor(UIManager.COLOR_WORD_NOS));
		final String STR_ATT_NAME = ATT_STR_BASIC_NICKNAME;
		final String STR_ATT_RACE = ATT_STR_BASIC_RACE;
		g.drawString(STR_ATT_NAME, tempX, tempY, 0);
		tempY += H_PRE;
		g.drawString(STR_ATT_RACE, tempX, tempY, 0);
		// 绘制属性值
		tempX += AbstractGameScreen.s_font.stringWidth(STR_ATT_NAME);
		tempY = INITY;
		g.setColor(UIManager.getPaletteColor(UIManager.COLOR_WORD_YESS));
		UITools.paintScrollStr(g, tempX, tempY, W_RECT_INFO_BASIC_NAME, H_PRE, m_basic_name);
		tempY += H_PRE;
		g.drawString(m_basic_race, tempX, tempY, 0);
	}

	private void paintContents(Graphics g)
	{
		// 计算内容框的XYWH
		int tempX = m_x;
		int tempY = m_y;
		int tempW = W_RECT_CONTENTS;
		int tempH = m_h_rect;
		switch (m_state) {
			case STATE_BASIC:
				tempX += X_BASIC_CONTENTS;
				tempY += Y_BASIC_CONTENTS;
				tempW = UITools.W_RECT;
				break;
			case STATE_FIGHT:
				tempX += X_OTHERS_CONTENTS;
				tempY += Y_OTHERS_CONTENTS;
				break;
			default:
				tempX += X_OTHERS_CONTENTS;
				tempY += Y_OTHERS_CONTENTS;
				break;
		}
		//
		int clipX = g.getClipX();
		int clipY = g.getClipY();
		int clipW = g.getClipWidth();
		int clipH = g.getClipHeight();
		UITools.paintContentRect(g, tempX, tempY, tempW, tempH);
		tempX += UITools.IW_RECT_CONTENT;
		tempY += UITools.IH_RECT_CONTENT;
		g.setClip(tempX, tempY, tempW - (UITools.IW_RECT_CONTENT << 1), tempH - (UITools.IH_RECT_CONTENT << 1));
		int labelIndex = getLabelIndex();
		if (m_state == STATE_BASIC) {
			paintItems(g, tempX, tempY - m_y_basic, labelIndex);
			if (m_y_basic >= H_SUMS[labelIndex]) {
				m_y_basic = 0;
			}
			else {
				m_y_basic++;
			}
		}
		else {
			paintItems(g, tempX, tempY, getLabelIndex());
		}
		g.setClip(clipX, clipY, clipW, clipH);
	}

	/**
	 * 2012-3-14 下午08:01:29 venizeng
	 * @param g
	 * @param i
	 * @param j
	 * @param labelIndex
	 */
	private void paintItems(Graphics g, int x, int y, int labelIndex)
	{
		short[] keys = m_keys[labelIndex];
		short[] heights = H_ITEMS[labelIndex];
		if (keys == null) {
			return;
		}
		int tempY = y + m_relY;
		int endY = y + m_h_content;
		int ih = ((H_PRE - AbstractGameScreen.FONT_H) >> 1);
		for (int i = 0, length = keys.length; i < length; i++) {
//			if (tempY < y) {// 显示范围在屏幕之上
//				tempY += H_PRE;
//			}
//			else if (tempY > endY) {// 显示范围在屏幕之下
//				return;
//			}
//			else {
//				boolean isSel = m_index == i;
//				paintItem(g, x, tempY + ih, keys[i], isSel);// h在此添加
//				tempY += heights[i];
//			}

			boolean isSel = m_index == i;
			paintItem(g, x, tempY + ih, keys[i], isSel);// h在此添加
			tempY += heights[i];
		}
	}

	/**
	 * 2012-3-14 下午10:32:01 venizeng
	 * @param g
	 * @param x
	 * @param i
	 * @param s
	 * @param isSel
	 */
	private void paintItem(Graphics g, int x, int y, short key, boolean isSel)
	{

		int tempX = x;
		int tempY = y;
		switch (key) {
			case id_name:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_NICKNAME, m_basic_name, isSel);
				break;
			case id_zhiye:// 职业：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_CAREER, ActorRole.ROLE_VOCATION_LIST[m_basic_career], isSel);
				break;
			case id_zhongzu:// 种族：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_RACE, m_basic_race, isSel);
				break;
			case id_xingbie:// 性别：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_GENDER, m_basic_sex, isSel);
				break;
			case id_dengji:// 当前等级：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_LEVEL_CURR, m_basic_level_curr, isSel);
				break;
			case id_zhenying:
				if (m_basic_zhenying == null) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_ZHENYING, m_basic_zhenying, isSel);
				break;
			case id_dangqianjingyan:// 当前经验：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_EXPER_CURR, m_basic_exper_curr, isSel);
				break;
			case id_xiajijingyan:// 下级经验：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_EXPER_NEXT, m_basic_exper_next, isSel);
				break;
			case id_jingli:
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_JINGLI, m_basic_jingli, isSel);
				break;
			case id_shenghuojinengA:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_SKILL_LIFE_A, m_basic_skillLife_a, isSel);
				break;
			case id_shenghuodengjiA:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_LEVEL_LIFE_A, m_basic_levelLife_a, isSel);
				break;
			case id_shenghuojinengB:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_SKILL_LIFE_B, m_basic_skillLife_b, isSel);
				break;
			case id_shenghuodengjiB:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_LEVEL_LIFE_B, m_basic_levelLife_b, isSel);
				break;
			case id_caiji:
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_CAIJI, m_basic_caiji, isSel);
				break;
			case id_tgf:
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_TGF, m_basic_tgf, isSel);
				break;
			case id_bgl:
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_BGL, m_basic_bgl, isSel);
				break;
			case id_vip_level:
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_VIP_LEVEL, m_basic_vip_level, isSel);
				break;
			case id_vip_time:
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_VIP_TIME, m_basic_vip_time, isSel);
				break;
			case id_vip_time_de:
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_VIP_DE, m_basic_vip_de, isSel);
				break;
			//
			case ID_BASIC_MONEYGAME:// 钱：
				paintMoneyGame(g, tempX, tempY, ATT_STR_BASIC_MONEYGAME, m_basic_money_game, isSel);
				break;
			case ID_BASIC_MONEYRMB:// 元宝：
				paintMoneyRmb(g, tempX, tempY, ATT_STR_BASIC_MONEYRMB, m_basic_money_rmb, isSel);
				break;
			case ID_BASIC_MONEYYINPIAO:// 名称：
				paintMoneyYingpiao(g, tempX, tempY, ATT_STR_BASIC_MONEYYINPIAO, m_basic_money_yingpiao, isSel);
				break;
			//
			case id_zhuangbeipinfen:// 
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_EQUIPPOINT, zhuangbeipinfen, isSel);
				break;
			case id_maxHp:// HP：
				paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_MAXHP, maxHp, isSel);
				break;
			case id_maxMp:// MP：
				switch (m_basic_career) {
					case 1:// 剑客
					case 4:// 剑俠
					case 5:// 剑豪
					case 10:// 剑神
					case 11:// 剑魔
					case 12:// 剑圣
						paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_MAXSP, maxMp, isSel);
						break;
					case 2:// 武者
					case 6:// 猛将
					case 7:// 斗士
					case 13:// 战狂
					case 14:// 天将
					case 15:// 武圣
						paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_MAXDP, maxMp, isSel);
						break;
					case 3:// 道士
					case 8:// 方士
					case 9:// 术士
					case 16:// 阎罗
					case 17:// 天师
					case 18:// 道圣
						paintOneAtt(g, tempX, tempY, ATT_STR_BASIC_MAXMP, maxMp, isSel);
						break;
				}
				break;
			case id_wuligongji:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_PHY, wuligongji, isSel);
				break;
			case id_zuixiaofagong:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_MAGIC_MIN, zuixiaofagong, isSel);
				break;
			case id_zuidafagong:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_MAGIC_MAX, zuidafagong, isSel);
				break;
			case id_wulifangyu:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_DEFENCE_PHY, wulifangyu, isSel);
				break;
			case id_fasufangyu:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_DEFENCE_MAGIC, fasufangyu, isSel);
				break;
			case id_jichumingzhong:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_HIT_BASIC, jichumingzhong, isSel);
				break;
			case id_liliang:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_FORCE, liliang, isSel);
				break;
			case id_zhili:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_INTELLIGENCE, zhili, isSel);
				break;
			case id_jiqiao:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_JIQIAO, jiqiao, isSel);
				break;
			case id_minjie:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_MINJIE, minjie, isSel);
				break;
			case id_naili:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_NAILI, naili, isSel);
				break;
			case id_luck:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_LUCK, luck, isSel);
				break;
			case id_hphuifusudu:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_SPEED_HP, hphuifusudu, isSel);
				break;
			case id_mphuifusudu:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_SPEED_MP, mphuifusudu, isSel);
				break;
			case id_jianqihuifu:
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_SPEED_SWARD, jianqihuifu, isSel);
				break;
			case id_douqihuifu:
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_SPEED_DOUQI, douqihuifu, isSel);
				break;
			case id_fashangjiacheng:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_MAGIC_ADD, fashangjiacheng, isSel);
				break;
			case id_yinxingshanghaijiacheng:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_YINXING_ADD, yinxingshanghaijiacheng, isSel);
				break;
			case id_bingxingqianghua:
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_BINGXING_ADD, bingxingqianghua, isSel);
				break;
			case id_huangxingqianghua:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_HUANGXING_ADD, huangxingqianghua, isSel);
				break;
			case id_shengxingqianghua:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_SHENXING_ADD, shengxingqianghua, isSel);
				break;
			case id_wulibaojilv:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_BAOJI_PHY, wulibaojilv, isSel);
				break;
			case id_fasubaojilv:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_BAOJI_MAGIC, fasubaojilv, isSel);
				break;
			case id_wubaoshanghaijaicheng:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_BAOJI_PHY_ADD, wubaoshanghaijaicheng, isSel);
				break;
			case id_fabaoshanghaijiacheng:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_BAOJI_MAGIC_ADD, fabaoshanghaijiacheng,
						isSel);
				break;
			case id_wulichuantou:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_CHUANTOU_PHY, wulichuantou, isSel);
				break;
			case id_fasuchuantou:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_CHUANTOU_MAGIC, fasuchuantou, isSel);
				break;
			case id_huibilv:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_HUIBILV, huibilv, isSel);
				break;
			case id_wushangjianmian:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_JIANMIAN_PHY, wushangjianmian, isSel);
				break;
			case id_fashangjianmian:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_JIANMIAN_MAGIC, fashangjianmian, isSel);
				break;
			case id_baojishanghaijianmian:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_ATTACT_JIANMIAN_BAOJI, baojishanghaijianmian, isSel);
				break;
			case id_yinkangxingjiacheng:
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_DEFENCE_ADD_YINXING, yinkangxingjiacheng, isSel);
				break;
			case id_bingkangqianghua:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_DEFENCE_ADD_BINGXING, bingkangqianghua, isSel);
				break;
			case id_huangkangqianghua:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_DEFENCE_ADD_HUANGXING, huangkangqianghua, isSel);
				break;
			case id_shengkangqianghua:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_FIGHT_DEFENCE_ADD_SHENXING, shengkangqianghua, isSel);
				break;
			//	
			case id_jiazu:// 名称：
				paintOneAtt(g, tempX, tempY, ATT_STR_SOCIAL_FAMILY, jiazu, isSel);
				break;
			case id_jiazugongxian:
				paintOneAtt(g, tempX, tempY, ATT_STR_SOCIAL_FAMILY_GONGXIAN, jiazugongxian, isSel);
				break;
			case id_chenghao:// ：
				paintOneAtt(g, tempX, tempY, ATT_STR_SOCIAL_CHENGHAO, chenghao, isSel);
				break;
			case id_zhangongdianshu:
				paintOneAtt(g, tempX, tempY, ATT_STR_SOCIAL_ZHANGONG, zhangongdianshu, isSel);
				break;
			case id_peiou:// 配偶：
				paintOneAtt(g, tempX, tempY, ATT_STR_SOCIAL_MATE, peiou, isSel);
				break;
			case id_peiouqinmidu://
				if (peiouqinmidu == 0) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STR_SOCIAL_MATE_QINMIDU, peiouqinmidu, isSel);
				break;
			case id_shifuchengjiudu:// 名称：
				if (shifuchengjiudu == 0) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STR_SOCIAL_MASTER_CHENGJIUDU, shifuchengjiudu, isSel);
				break;
			//
			case id_shijiepaiming:
				if (shijiepaiming == 0 || shijiepaiming == -1) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STT_RONGYU_SHIJIE, shijiepaiming, isSel);
				break;
			case id_zhenyingpaiming:
				if (zhenyingpaiming == 0 || zhenyingpaiming == -1) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STT_RONGYU_ZHENYING, zhenyingpaiming, isSel);
				break;
			case id_jiazupaiming:
				if (jiazupaiming == 0 || id_jiazupaiming == -1) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STT_RONGYU_JIAZU, jiazupaiming, isSel);
				break;
			case id_qiechuoshengli:
				if (qiechuoshengli == -1) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STT_RONGYU_QIECHOU_SHENGLI, qiechuoshengli, isSel);
				break;
			case id_qiechuobaibei:
				if (qiechuobaibei == -1) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STT_RONGYU_QIECHOU_BAIBEI, qiechuobaibei, isSel);
				break;
			case id_shadishumu:
				if (shadishumu == -1) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STT_RONGYU_SHADI, shadishumu, isSel);
				break;
			case id_beishacishu:
				if (beishashucishu == -1) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STT_RONGYU_BEISHAN, beishashucishu, isSel);
				break;
			case id_dongfupaiming:
				if (dongfupaiming == 0) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STT_RONGYU_DONGFU, dongfupaiming, isSel);
				break;
			case id_shengchangcishu:
				if (shengchangcishu == -1) {
					break;
				}
				paintOneAtt(g, tempX, tempY, ATT_STT_RONGYU_SHENGCHAN, shengchangcishu, isSel);
				break;
			case id_hyper:
				if (m_hyper != null) {
					m_hyper.paintHyperLink(g, tempX, tempY);
				}
			default:
				Tools.debugPrintln("paint UIAttribute:错误的key值= " + key);
				break;
		}
	}

	/**
	 * 当前道具只具有一个值
	 * 
	 * @param g
	 * @param y
	 * @param x
	 * @param att
	 * @param content
	 * @param isSel
	 * @return
	 */
	private void paintOneAtt(Graphics g, int x, int y, String att, String content, boolean isSel)
	{
		g.setColor(COLOR_ATT);
		g.drawString(att, x, y, Tools.LEFT_TOP);
		int tempX = (x + AbstractGameScreen.s_font.stringWidth(att) + IW_STR);
		if (content == null) {
			return;
		}
		g.setColor(COLOR_A);
		g.drawString(content, tempX, y + 1, Tools.LEFT_TOP);
	}

	/**
	 * 当前道具只具有一个值
	 * 
	 * @param g
	 * @param y
	 * @param x
	 * @param att
	 * @param content
	 * @param isSel
	 * @return
	 */
	private void paintOneAtt(Graphics g, int x, int y, String att, long content, boolean isSel)
	{
		paintOneAtt(g, x, y, att, String.valueOf(content), isSel);
	}

	/**
	 * 2012-2-22 下午02:44:07 venizeng
	 * @param g
	 * @param x
	 * @param y
	 * @param att
	 * @param l
	 * @param isFocused
	 * @return
	 */
	private void paintMoneyGame(Graphics g, int x, int y, String att, long l, boolean isFocused)
	{
		g.setColor(COLOR_ATT);
		g.drawString(att, x, y, Tools.LEFT_TOP);
		UITools.paintMoneyGameLB(g, x + AbstractGameScreen.s_font.stringWidth(att) + 2, y + AbstractGameScreen.FONT_H,
				l, isFocused);
	}

	/**
	 * 2012-2-22 下午02:44:07 venizeng
	 * @param g
	 * @param x
	 * @param y
	 * @param att
	 * @param l
	 * @param isFocused
	 * @return
	 */
	private void paintMoneyRmb(Graphics g, int x, int y, String att, long l, boolean isFocused)
	{
		g.setColor(COLOR_ATT);
		g.drawString(att, x, y, Tools.LEFT_TOP);
		UITools.paintMoneyRmbLB(g, x + AbstractGameScreen.s_font.stringWidth(att) + 2, y + AbstractGameScreen.FONT_H,
				l, isFocused);
	}

	/**
	 * 2012-4-11 下午10:27:55
	 * venizeng
	 * @param g
	 * @param tempX
	 * @param tempY
	 * @param aTTSTRBASICMONEYYINPIAO
	 * @param mBasicMoneyYingpiao
	 * @param isSel
	 */
	private void paintMoneyYingpiao(Graphics g, int x, int y, String att,
			long l, boolean isSel)
	{
		g.setColor(COLOR_ATT);
		g.drawString(att, x, y, Tools.LEFT_TOP);
		UITools.paintMoneyYinpiaoLB(g, x + AbstractGameScreen.s_font.stringWidth(att) + 2, y
				+ AbstractGameScreen.FONT_H, l, isSel);
	}

	private void paintDrag(Graphics g)
	{
		if (m_state == STATE_BASIC) {
			return;
		}
		UITools.paintScrollBar(g, m_x + UITools.X_DRAG, m_y + m_y_drag, m_h_rect, m_plan);
	}

	private void paintFocused(Graphics g)
	{
		if (m_state != STATE_FIGHT) {
			return;
		}
		UITools.drawSelectBox(g, m_x + m_x_fos, m_y + m_y_fos, m_w_fos, m_h_fos);
	}

	/**
	 * 2012-3-14 下午10:49:33 venizeng
	 * @param g
	 */
	private int m_relX_fight;

	private void paintFightDescribe(Graphics g)
	{
		if (m_state != STATE_FIGHT) {
			return;
		}
		int tempX = m_x + X_FIGHT_DESCRIBE;
		int tempY = m_y + Y_FIGHT_DESCRIBE;
		UITools.paintContentRect(g, tempX, tempY, W_RECT_CONTENTS, H_FIGHT_DESCRIBE);
		g.setColor(UIManager.getPaletteColor(UIManager.COLOR_WORD_NOS));
		tempX += UITools.IW_RECT_CONTENT;
		tempY += UITools.IH_RECT_CONTENT;
		paintScrollStr(g, tempX, tempY, W_RECT_CONTENTS - (UITools.IW_RECT_CONTENT << 1), H_FIGHT_DESCRIBE,
				m_str_fight_describe, 3, 1);
	}

	private final void paintScrollStr(Graphics g, int x, int y, int w, int h, String str, int speed, int direction)
	{
		if (str == null) {
			return;
		}
		int clipX = g.getClipX();
		int clipY = g.getClipY();
		int clipW = g.getClipWidth();
		int clipH = g.getClipHeight();
		g.setClip(x, y, w, h);
		int sw = AbstractGameScreen.s_font.stringWidth(str);
		if (sw > w) {
			sw += 20;// 间隔
			int iw = m_relX_fight % sw;
			int tempX = x - iw;
			g.drawString(str, tempX, y, 0);
			g.drawString(str, tempX + sw, y, 0);
			m_relX_fight += 2;
			if (m_relX_fight >= sw) {
				m_relX_fight = 0;
			}
		}
		else {
			g.drawString(str, x, y, 0);
		}
		g.setClip(clipX, clipY, clipW, clipH);
	}

	private final String TITLE = "个人属性";
	//
	private final int STATE_BASIC = 1;// 基础
	private final int STATE_FIGHT = 2;// 战斗
	private final int STATE_SHEHUI = 3;// 声望
	private final int STATE_RONGYU = 4;// 荣誉
	//
	private final int NUM_LABEL_DIS = 4;// 显示的标签数目
	private final String STR_BASIC_OTHER = "点击查看详情";
	// DATA
	private short[][] m_keys;// keys
	private ActorItem[] m_items;
	private ActorRole m_role;
	// LOGIC
	private long m_id;//
	private int m_frameIndex;
	private int m_actionId = 1;
	//
	private int m_state_first = STATE_BASIC;
	private int m_index_top;// 顶部索引
	private int m_relY = 0;
	private short[][] H_ITEMS;
	private int[] H_SUMS;
	//
	private int m_h_rect;// 内容框高度
	private int m_h_content;// 总内容高度
	private int m_num_dis;// 显示的行数
	private int m_y_drag;
	//
	private int m_plan;
	//
	private int m_x_fos;
	private int m_y_fos;
	private int m_w_fos;
	private int m_h_fos;
	//
	private int m_y_basic = 0;
	//
	private String m_str_fight_describe;
	//
	private final int NUMBER_USELESS = -1;
	private final short id_name = 1;
	private final short id_zhiye = 2;
	private final short id_zhongzu = 3;
	private final short id_xingbie = 4;
	private final short id_dengji = 5;
	private final short id_zhenying = 6;
	private final short id_dangqianjingyan = 7;
	private final short id_xiajijingyan = 8;
	private final short id_jingli = 9;
	private final short id_shenghuojinengA = 10;
	private final short id_shenghuodengjiA = 11;
	private final short id_shenghuojinengB = 12;
	private final short id_shenghuodengjiB = 13;
	private final short id_vip_level = 14;//byte
	private final short id_vip_time = 15;//long
	private final short id_vip_time_de = 16;//long
	private final short id_caiji = 24;
	private final short id_tgf = 25;
	private final short id_bgl = 26;
	private final short id_hyper = 27 ;

	private final short id_zhuangbeipinfen = 31;
	private final short id_maxHp = 32;
	private final short id_maxMp = 33;
	private final short id_wuligongji = 34;
	private final short id_zuixiaofagong = 35;
	private final short id_zuidafagong = 36;
	private final short id_wulifangyu = 37;
	private final short id_fasufangyu = 38;
	private final short id_jichumingzhong = 39;
	private final short id_liliang = 40;
	private final short id_zhili = 41;
	private final short id_jiqiao = 42;
	private final short id_minjie = 43;
	private final short id_naili = 44;
	private final short id_luck = 45;
	private final short id_hphuifusudu = 46;
	private final short id_mphuifusudu = 47;
	private final short id_jianqihuifu = 48;
	private final short id_douqihuifu = 49;
	private final short id_fashangjiacheng = 50;
	private final short id_yinxingshanghaijiacheng = 51;
	private final short id_bingxingqianghua = 52;
	private final short id_huangxingqianghua = 53;
	private final short id_shengxingqianghua = 54;
	private final short id_wulibaojilv = 55;
	private final short id_fasubaojilv = 56;
	private final short id_wubaoshanghaijaicheng = 57;
	private final short id_fabaoshanghaijiacheng = 58;
	private final short id_wulichuantou = 59;
	private final short id_fasuchuantou = 60;
	private final short id_huibilv = 61;
	private final short id_wushangjianmian = 62;
	private final short id_fashangjianmian = 63;
	private final short id_baojishanghaijianmian = 64;
	private final short id_yinkangxingjiacheng = 65;
	private final short id_bingkangqianghua = 66;
	private final short id_huangkangqianghua = 67;
	private final short id_shengkangqianghua = 68;

	private final short id_jiazu = 101;
	private final short id_jiazugongxian = 102;
	private final short id_chenghao = 103;
	private final short id_zhangongdianshu = 104;
	private final short id_peiou = 105;
	private final short id_peiouqinmidu = 106;
	private final short id_shifuchengjiudu = 107;

	private final short id_shijiepaiming = 141;
	private final short id_zhenyingpaiming = 142;
	private final short id_jiazupaiming = 143;
	private final short id_qiechuoshengli = 144;
	private final short id_qiechuobaibei = 145;
	private final short id_shadishumu = 146;
	private final short id_beishacishu = 147;
	private final short id_dongfupaiming = 148;
	private final short id_shengchangcishu = 149;
	//Other
	private final int ID_BASIC_MONEYGAME = 1111;// 金钱：
	private final int ID_BASIC_MONEYRMB = 1112;// 元宝：
	private final int ID_BASIC_MONEYYINPIAO = 1113;// 银票：

	private final String ATT_STR_BASIC_NICKNAME = "名称:";// 名称：
	private final String ATT_STR_BASIC_CAREER = "职业:";// 职业
	private final String ATT_STR_BASIC_RACE = "种族:";// 种族：
	private final String ATT_STR_BASIC_GENDER = "性别:";// 性别：
	private final String ATT_STR_BASIC_LEVEL_CURR = "等级:";// 等级：
	private final String ATT_STR_BASIC_ZHENYING = "阵营:";
	private final String ATT_STR_BASIC_EXPER_CURR = "当前经验:";// 当前经验
	private final String ATT_STR_BASIC_EXPER_NEXT = "下级经验:";// 下级经验
	private final String ATT_STR_BASIC_JINGLI = "精力:";// 下级经验
	private final String ATT_STR_BASIC_SKILL_LIFE_A = "生活技能A:";// 生活技能A：
	private final String ATT_STR_BASIC_LEVEL_LIFE_A = "生活等级A:";// 生活等级A：
	private final String ATT_STR_BASIC_SKILL_LIFE_B = "生活技能B:";// 生活技能B：
	private final String ATT_STR_BASIC_LEVEL_LIFE_B = "生活等级B:";// 生活等级B：
	private final String ATT_STR_BASIC_CAIJI = "采集技能:";// 生活等级A：
	private final String ATT_STR_BASIC_TGF = "天工坊制造:";// 生活技能B：
	private final String ATT_STR_BASIC_BGL = "八卦炉制造:";// 生活等级B：
	private final String ATT_STR_BASIC_VIP_LEVEL = "VIP等级:";
	private final String ATT_STR_BASIC_VIP_TIME = "VIP时间:";
	private final String ATT_STR_BASIC_VIP_DE = "VIP双倍经验:";
	//
	private final String ATT_STR_BASIC_EQUIPPOINT = "装备评分:";// 装备评分：
	private final String ATT_STR_BASIC_MAXHP = "最大HP:";// 最大HP
	private final String ATT_STR_BASIC_MAXMP = "最大MP:";// 最大MP/斗气/剑气
	private final String ATT_STR_BASIC_MAXDP = "最大斗气:";
	private final String ATT_STR_BASIC_MAXSP = "最大剑气:";
	private final String ATT_STR_FIGHT_ATTACT_PHY = "物理攻击:";// 物理攻击:
	private final String ATT_STR_FIGHT_ATTACT_MAGIC_MIN = "最小法攻:";// 最小法攻:
	private final String ATT_STR_FIGHT_ATTACT_MAGIC_MAX = "最大法攻:";// 最大法攻
	private final String ATT_STR_FIGHT_DEFENCE_PHY = "物理防御:";// 物理防御:
	private final String ATT_STR_FIGHT_DEFENCE_MAGIC = "法术防御:";// 法术防御
	private final String ATT_STR_FIGHT_HIT_BASIC = "基础命中:";// 基础命中
	private final String ATT_STR_FIGHT_FORCE = "力量:";// 力量
	private final String ATT_STR_FIGHT_INTELLIGENCE = "智力:";// 智力
	private final String ATT_STR_FIGHT_JIQIAO = "技巧:";// 技巧
	private final String ATT_STR_FIGHT_MINJIE = "敏捷:";// 敏捷
	private final String ATT_STR_FIGHT_NAILI = "耐力:";// 耐力
	private final String ATT_STR_FIGHT_LUCK = "运气:";// 运气
	private final String ATT_STR_FIGHT_SPEED_HP = "HP恢复速度:";// HP恢复速度
	private final String ATT_STR_FIGHT_SPEED_MP = "MP恢复速度:";// MP恢复速度
	private final String ATT_STR_FIGHT_SPEED_SWARD = "剑气恢复+:";// 剑气恢复+,
	private final String ATT_STR_FIGHT_SPEED_DOUQI = "斗气恢复+:";// 斗气恢复+
	private final String ATT_STR_FIGHT_ATTACT_MAGIC_ADD = "法伤加成 :";// 法伤加成
	private final String ATT_STR_FIGHT_ATTACT_YINXING_ADD = "阴性强化:";// 阴性强化
	private final String ATT_STR_FIGHT_ATTACT_BINGXING_ADD = "冰性强化:";// 冰性强化
	private final String ATT_STR_FIGHT_ATTACT_HUANGXING_ADD = "煌性强化:";// 煌性强化
	private final String ATT_STR_FIGHT_ATTACT_SHENXING_ADD = "圣性强化 :";// 圣性强化
	private final String ATT_STR_FIGHT_ATTACT_BAOJI_PHY = "物理暴击:";// 物理暴击
	private final String ATT_STR_FIGHT_ATTACT_BAOJI_MAGIC = "法术暴击:";// 法术暴击
	private final String ATT_STR_FIGHT_ATTACT_BAOJI_PHY_ADD = "物暴伤害加:";// 物暴伤害加
	private final String ATT_STR_FIGHT_ATTACT_BAOJI_MAGIC_ADD = "法暴伤害加:";// 法暴伤害加
	private final String ATT_STR_FIGHT_ATTACT_CHUANTOU_PHY = "物理穿透 :";// 物理穿透
	private final String ATT_STR_FIGHT_ATTACT_CHUANTOU_MAGIC = "法术穿透:";// 法术穿透
	private final String ATT_STR_FIGHT_HUIBILV = "回避率:";// 回避率
	private final String ATT_STR_FIGHT_ATTACT_JIANMIAN_PHY = "物伤减免:";// 物伤减免
	private final String ATT_STR_FIGHT_ATTACT_JIANMIAN_MAGIC = "法伤减免 :";// 法伤减免
	private final String ATT_STR_FIGHT_ATTACT_JIANMIAN_BAOJI = "暴击伤害减免:";// 暴击伤害减免
	private final String ATT_STR_FIGHT_DEFENCE_ADD_YINXING = "阴抗强化:";// 阴抗强化
	private final String ATT_STR_FIGHT_DEFENCE_ADD_BINGXING = "冰抗强化:";// 冰抗强化
	private final String ATT_STR_FIGHT_DEFENCE_ADD_HUANGXING = "煌抗强化:";// 煌抗强化
	private final String ATT_STR_FIGHT_DEFENCE_ADD_SHENXING = "圣抗强化:";// 圣抗强化
	//
	private final String ATT_STR_SOCIAL_FAMILY = "家族:";// 家族：
	private final String ATT_STR_SOCIAL_FAMILY_GONGXIAN = "家族贡献:";// 家族：
	private final String ATT_STR_SOCIAL_CHENGHAO = "称号:";// 称号：
	private final String ATT_STR_SOCIAL_ZHANGONG = "战功点数:";// 称号：
	private final String ATT_STR_SOCIAL_MATE = "配偶:";// 配偶：
	private final String ATT_STR_SOCIAL_MATE_QINMIDU = "配偶亲密度:";// 配偶亲密度：
	private final String ATT_STR_SOCIAL_MASTER_CHENGJIUDU = "师父成就值:";// 师父成就值：
	//
	private final String ATT_STT_RONGYU_SHIJIE = "世界排名";
	private final String ATT_STT_RONGYU_ZHENYING = "阵营排名";
	private final String ATT_STT_RONGYU_JIAZU = "家族排名";
	private final String ATT_STT_RONGYU_QIECHOU_SHENGLI = "切磋胜利";
	private final String ATT_STT_RONGYU_QIECHOU_BAIBEI = "切磋败北";
	private final String ATT_STT_RONGYU_SHADI = "杀敌数目";
	private final String ATT_STT_RONGYU_BEISHAN = "被杀次数";
	private final String ATT_STT_RONGYU_DONGFU = "洞府排名";
	private final String ATT_STT_RONGYU_SHENGCHAN = "生产次数";

	private final String ATT_STR_BASIC_MONEYGAME = "金钱:";// 金钱：
	private final String ATT_STR_BASIC_MONEYRMB = "元宝:";// 元宝：
	private final String ATT_STR_BASIC_MONEYYINPIAO = "银票:";// 银票：

	private String m_basic_name;
	private byte m_basic_career;
	private String m_basic_race;
	private String m_basic_sex;
	private int m_basic_level_curr;
	private String m_basic_zhenying;
	private int m_basic_exper_curr;
	private int m_basic_exper_next;
	private int m_basic_jingli;
	private String m_basic_skillLife_a;
	private String m_basic_levelLife_a;
	private String m_basic_skillLife_b;
	private String m_basic_levelLife_b;
	private String m_basic_vip_level;
	private String m_basic_vip_time;
	private String m_basic_vip_de;
	private String m_basic_caiji;
	private String m_basic_tgf;
	private String m_basic_bgl;
	
	private AbsHyperLinker m_hyper ;//超链接

	//
	private int zhuangbeipinfen;
	private int maxHp;
	private int maxMp;
	private int wuligongji;
	private int zuixiaofagong;
	private int zuidafagong;
	private int wulifangyu;
	private int fasufangyu;
	private int jichumingzhong;
	private int liliang;
	private int zhili;
	private int jiqiao;
	private int minjie;
	private int naili;
	private int luck;
	private int hphuifusudu;
	private int mphuifusudu;
	private int jianqihuifu;
	private int douqihuifu;
	private int fashangjiacheng;
	private int yinxingshanghaijiacheng;
	private int bingxingqianghua;
	private int huangxingqianghua;
	private int shengxingqianghua;
	private int wulibaojilv;
	private int fasubaojilv;
	private int wubaoshanghaijaicheng;
	private int fabaoshanghaijiacheng;
	private int wulichuantou;
	private int fasuchuantou;
	private int huibilv;
	private int wushangjianmian;
	private int fashangjianmian;
	private int baojishanghaijianmian;
	private int yinkangxingjiacheng;
	private int bingkangqianghua;
	private int huangkangqianghua;
	private int shengkangqianghua;
	//
	private String jiazu = "";
	private String jiazugongxian = "";
	private String chenghao = "";
	private int zhangongdianshu;
	private String peiou = "";
	private int peiouqinmidu;
	private int shifuchengjiudu;
	//
	private int shijiepaiming;
	private int zhenyingpaiming;
	private int jiazupaiming;
	private int qiechuoshengli;
	private int qiechuobaibei;
	private int shadishumu;
	private int beishashucishu;
	private int dongfupaiming;
	private int shengchangcishu;

	private long m_basic_money_game;
	private long m_basic_money_rmb;
	private long m_basic_money_yingpiao;
	//
	private byte[] NAME_EQUIP_POS = new byte[] { 5, 0, 2, 1, 4, 3, 8, 6, 9, 6, 7, 6 };
	private final int H_PRE = UITools.H_PRE;// 每行的高度
	// 标签指引箭头
	private int X_LABEL_ARR_LEFT;
	private int X_LABEL_ARR_RIGHT;
	// 标签
	private int X_LABEL_FIRST;
	private int Y_LABEL;
	// 动画（玩家自己，和他人）
	private int X_ANIM_BASIC_SELF;
	private int X_ANIM_BASIC_OTHER;
	private int Y_ANIM_BASIC;
	// 他人的装备栏
	private int X_EQUIP_LEFT;
	private int X_EQUIP_RIGHT;
	private int Y_EQUIP;
	// 玩家自己的基础信息
	private int X_SELF_BASIC;
	private int Y_SELF_BASIC;
	// 信息栏，显示相应状态下的内容
	private int X_BASIC_CONTENTS;
	private int Y_BASIC_CONTENTS;
	private int X_OTHERS_CONTENTS;
	private int Y_OTHERS_CONTENTS;
	// 战斗属性的描述框
	private int X_FIGHT_DESCRIBE;
	private int Y_FIGHT_DESCRIBE;
	// 标签
	private final int W_LABEL = UITools.W_LABEL_MIDDLE;
	private final int H_LABEL = UITools.H_LABEL;
	private final int IW_LABEL = 4;
	// 动画
	private final int W_ANIM = UITools.W_ANIM;
	private final int H_ANIM = UITools.H_ANIM;
	// 他人的装备栏
	private int IW_EQUIP = 7;
	private int IH_EQUIP = 4;
	private int RW_EQUIP;
	private int RH_EQUIP;
	// 玩家自己的基础信息
	private int W_RECT_SELF_BASIC;
	private int H_RECT_SELF_BASIC;
	// 内容框高度
	private int W_RECT_CONTENTS;
	private int H_RECT_CONTENTS_BASIC;
	private int H_RECT_CONTENTS_FIGHT;
	private int H_RECT_CONTENTS_OTHERS;
	// 内容层高度
	private int H_CONTENT_CONTENTS_BASIC;
	private int H_CONTENT_CONTENTS_FIGHT;
	private int H_CONTENT_CONTENTS_OTHERS;
	// 战斗属性的描述框
	private int H_FIGHT_DESCRIBE;
	// 自己的信息框 - 名字的宽度
	private int W_RECT_INFO_BASIC_NAME;
	//
	private int W_BG = UITools.W_BG;
	private int H_BG = UITools.H_BG;
	//
	private int NUM_CONTENT_BASIC;
	private int NUM_CONTENT_FIGHT;
	private int NUM_CONTENT_OTHERS;
	//
	private final int IW_STR = 5;// 属性到值之间的间隔
	private final int COLOR_ATT = UIManager.getPaletteColor(UIManager.COLOR_WORD_NOS);
	private final int COLOR_A = Tools.GREEN;

	protected void registerTouch() {
		clearAllRects();
		registerNormalSoft();
		int[][]rect = new int[][]{
				{167,41,34,21},	
				{205,41,34,21},	
				{244,41,34,21},	
				{281,41,34,21},	
				{169,269,152,29},//0
				{447,62,18,42},//up
				{447,210,18,72},//down
		};
		initTouchRect(rect);
	}

	protected void onTouchRect(int[][] rect, int touchid) {
		switch(touchid) {
		case 0:
		case 1:
		case 2:
		case 3:
			changeState(touchid+1);
			break;
		case 4:
			GameTouchManager.keyPressedNum(0);
			break;
		case 5:
			GameTouchManager.keyPressedDir(1);
			break;
		case 6:
			GameTouchManager.keyPressedDir(3);
			break;
		}
	}
	
	
}
